<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
    <meta name="format-detection"content="telephone=no, email=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" /><!-- 删除苹果默认的工具栏和菜单栏 -->
    <meta name="apple-mobile-web-app-status-bar-style" content="black" /><!-- 设置苹果工具栏颜色 -->
    <meta name=”renderer” content="ie-comp">
    <meta name=”renderer” content=”ie-stand”>
    <meta name="renderer" content="webkit"> 
    <meta name="keywords" content="耀盛中国,耀盛智投,理财产品,智选财富,耀盛智投官网"/>
    <meta name="description" content="耀盛智投为耀盛中国旗下理财产品智选平台。专注于为大众富裕阶层、精英个人、中产阶级家庭、合规机构等提供定制化资产配置咨询推荐服务，帮助客户实现财富的增值。" />
    <title>实名认证</title>
    <script src="../../lib/js/ftSize.js"></script>
    <link rel="stylesheet" href="../../lib/css/_base.css">
    <link rel="stylesheet" type="text/css" href="../../lib/css/forgotPassword.css">
    <link rel="stylesheet" href="../../lib/css/publicBubb.css">
</head>
<body>
   <h1 class="rem90"><img src="../../lib/images/left.png" class="leftImg" onClick="prevAttectation()">实名认证</h1>
    <!-- 验证身份证 -->
    <div class="">
        <div class="forgot">
            <div class="F_padding ">
                <div class="F_one F_bottom">
                    <input type="text" name="" placeholder="请输入真实姓名" id="attesName">
                </div>
                <div class="F_one F_bottom">
                    <input type="text" name="" placeholder="请输入正确的身份证号码" id="attesCard" maxlength="18">
                </div>
                <div class="F_one F_bottom">
                    <input type="text" name="" placeholder="请输入正确的银行卡号" maxlength="19" id="attesBank">
                </div>
                <div class="F_one F_bottom" style="border: none;">
                    <input type="password" name="" placeholder="请输入6~16位数字字母组合支付密码" id="attesPaypwd" minlength="6">
                </div>
            </div> 
        </div>
        <div class="attesWarn">错误提示</div>
        <div class="F_btn_n1" id="CertImmed">立即认证</div>
    </div>
<!-- 弹窗 -->
<div class="maskWrap" id="attestationMask">
    <div class="maskLayer">
        <div class="maskCross"></div>
            <div class="maskImg"></div>
        <div class="maskTitle">恭喜您，完成认证</div>
      <!--   <div class="maskContent"></div> -->
        <div class="maskbtnGroup">
            <a href="../../mine/recharge.html"> <span class="winBg"> 立即充值</span></a>
            <a href="../../mine/index.html"><span>随便逛逛</span></a>
            
        </div>  
    </div>
</div>
<script src="../../lib/js/jquery.min.js"></script>
<script src="../../lib/js/public-header.js"></script>
<script>
 $('.attesWarn').text('')
$('#attestationMask').hide()
/* 实名认证信息 */
/* 手机验证码 */
function attestationJson(userName,certNo,cardNo,payPassWord) {
    let wpuserToken=window.sessionStorage.getItem('wpuserToken');
    var json = {
        "faceCode":"user/authentication",
        "token":wpuserToken,    
        "clientInfo":"W,100,IE8",  
        "requestTime": formatDateTime(startTime),
        "body":{
            "userName":userName,//姓名
            "certNo":certNo,//身份证
            "cardNo":cardNo,//银行卡
            "certType":'',
            "payPassWord": payPassWord,//支付密码
        }
     }
    return json;
}
$('#CertImmed').click(function(){
    CertificatImmed()
})
/* 获取焦点时 */
$('#attesName').focus(function(){
    $('.attesWarn').text('')
})
$('#attesCard').focus(function(){
    $('.attesWarn').text('')
})
$('#attesBank').focus(function(){
    $('.attesWarn').text('')
})
$('#attesPaypwd').focus(function(){
    $('.attesWarn').text('')
})

/* 点击实名认证 */
function CertificatImmed(){
  
    let attesName=$('#attesName').val().trim();//姓名
    let attesCard=$('#attesCard').val().trim();//身份证号
    let attesBank=$('#attesBank').val().trim();//银行卡号
    let attesPaypwd=$('#attesPaypwd').val().trim();//密码组合
    if(attesName!='' && horseName.test(attesName)){
        if(attesCard!='' && attesCard.length==18){
            if(cardOne.test(attesCard)){
                if(attesBank!='' && bankCard.test(attesBank)){
                    if(attesPaypwd!='' && payPwd.test(attesPaypwd)){
                        $.ajax({  
                            type: "POST",
                            url: httpServer+"user/authentication",
                            headers:{
                                'Access-Control-Allow-Origin':'*'
                            }, 
                            async:false,
                            contentType: "application/json; charset=utf-8",
                            data: JSON.stringify(attestationJson(attesName,attesCard,attesBank,attesPaypwd)),
                            dataType: "json",
                            success: function (isAttestaion) {  
                                if(isAttestaion.resCode!='0'){
                                    $('.attesWarn').text(isAttestaion.errorMsg)
                                }else{
                                    $('#attestationMask').show()
                                }
                            },
                            error: function(error){  
                                console.log(error,2);  
                            }    
                        }); 
                    }else{
                        $('.attesWarn').text('请输入6~16位数字字母组合支付密码')
                    }
                }else{
                    $('.attesWarn').text('请输入正确的银行卡号')
                }
            }else{
                $('.attesWarn').text('请输入正确的身份证号码')
            }
        }else if(attesCard!='' && attesCard.length==15){
            if(cardTwo.test(attesCard)){
                if(attesBank!='' && bankCard.test(attesBank)){
                    if(attesPaypwd!='' && payPwd.test(attesPaypwd)){
                        $.ajax({  
                            type: "POST",
                            url: httpServer+"user/authentication",
                            headers:{
                                'Access-Control-Allow-Origin':'*'
                            }, 
                            async:false,
                            contentType: "application/json; charset=utf-8",
                            data: JSON.stringify(attestationJson(attesName,attesCard,attesBank,attesPaypwd)),
                            dataType: "json",
                            success: function (isAttestaion) {  
                                if(isAttestaion.resCode!='0'){
                                    $('.attesWarn').text(isAttestaion.errorMsg)
                                }else{
                                    $('#attestationMask').show()
                                }
                            },
                            error: function(error){  
                                console.log(error,2);  
                            }    
                        }); 
                    }else{
                        $('.attesWarn').text('请输入6~16位数字字母组合支付密码')
                    }
                }else{
                    $('.attesWarn').text('请输入正确的银行卡号')
                }
            }else{
                $('.attesWarn').text('请输入正确的身份证号码')
            }
        }else{
            $('.attesWarn').text('请输入正确的身份证号码')
        }
    }else{
        $('.attesWarn').text('请输入真实姓名')
    }    
}
</script>
</body>
</html>